<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>盒子顺正方形移动</title>
    <style>
        *{
            margin:0;
            padding: 0;
        }
        .box{
            width:50px;
            height: 50px;
            background-color:skyblue;
            animation-name:move,background,radius/*添加3个动画帧*/;
            /* animation: move 5s linear infinite; */
             animation-duration: 4s,2s,2s;/*设置动画持续时间*/

        }
 /* 第一种写法 */
       /* @keyframes move {
         0% {
           transform:translatex(0);
          }
         25% {
          transform: translatex(300px);
          }
         50% {
            transform: translate(300PX,300px);
           }
         75% {
            transform: translate(0,300PX);
        }
          100% {
           transform: translate(0,0);
          }
    }  */
    /* 第二种 */
    /* @keyframes move {
         25% {
          transform: translatex(300px);
          }
         50% {
            transform: translate(300PX,300px);
           }
         75% {
            transform: translateY(300PX);
        }
    }  */
    /* 多个动画叠加效果 */
    @keyframes move {
         25% {
          transform: translatex(300px);
          }
         50% {
            transform: translate(300PX,300px);
           }
         75% {
            transform: translateY(300PX);
        }
    }
    @keyframes background {
        25%{
            background-color: red;
        }
        50%{
            background-color: yellow;
        }
        75%{
            background-color: blue;
        }
        
    }
    @keyframes radius {/*圆角*/
        25%{
            border-radius:50%;
        }
        50%{
            border-radius:0;
        }
        75%{
            border-radius:50%;
        }
        
    }
    </style>
</head>
<body>
    <main>
        <div class="box"></div>
    </main>
</body>
</html>